gui: do not allow MainWindow to be resized
authorJyrki Gadinger <nilsding@nilsding.org>
Mon, 3 Mar 2025 16:53:56 +0000 (17:53 +0100)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Mon, 3 Mar 2025 18:12:08 +0000 (18:12 +0000)
previously macOS let you resize the activity window, resulting in
strange visual artifacts...

Signed-off-by: Jyrki Gadinger <nilsding@nilsding.org>
src/gui/tray/MainWindow.qml

index cf13b90be918be7fc28e591b1abce1aeca397633..a30f4fc9375d3c8dafd9b6765e4afba47fa33314 100644 (file)
@@ -43,7 +43,16 @@ ApplicationWindow {
 \r
     readonly property int maxMenuHeight: Style.trayWindowHeight - Style.trayWindowHeaderHeight - 2 * Style.trayWindowBorderWidth\r
 \r
-    Component.onCompleted: Systray.forceWindowInit(trayWindow)\r
+    Component.onCompleted: {\r
+        Systray.forceWindowInit(trayWindow)\r
+        if (Systray.useNormalWindow) {\r
+            return;\r
+        }\r
+\r
+        // do not allow this window to be resized when it's frameless\r
+        this.minimumWidth = this.maximumWidth = this.width\r
+        this.minimumHeight = this.maximumHeight = this.height\r
+    }\r
 \r
     // Close tray window when focus is lost (e.g. click somewhere else on the screen)\r
     onActiveChanged: {\r